package com.epam.facebook_client.fragment;

import android.os.Bundle;
import android.support.v4.app.Fragment;

import com.epam.facebook_client.services.ServiceCallbackListener;
import com.epam.facebook_client.services.ServiceHelper;

public abstract class BaseServiceFragment extends Fragment implements ServiceCallbackListener {

	private ServiceHelper serviceHelper;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		serviceHelper = ServiceHelper.get(this.getActivity());
	}

	@Override
	public void onResume() {
		super.onResume();
		serviceHelper.addListener(this);
	}

	@Override
	public void onPause() {
		super.onPause();
		serviceHelper.removeListener(this);
	}

	public ServiceHelper getServiceHelper() {
		return serviceHelper;
	}
}
